#include <stdio.h>
#include <fcntl.h>

int main() {
  int fd = open("/dev/exam_chr_dev", O_WRONLY);
  
  int x;
  int i;
  x = 0;
  int *p = &x;
  printf("%p\n", p);
  
  for (i = 0; i<10000000; ++i) {
    ++x;
    write(fd, &p, sizeof(p));
  }
  
  close(fd);
  
  printf("%d\n", x);
  return 0;
}